import 'package:flutter/material.dart';

class CartCase extends StatelessWidget {
  const CartCase({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        // 订单时间和状态
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              const Text("2024-08-15 21:49:48"),
              Text(
                "待发货",
                style: TextStyle(color: Colors.orange),
              )
            ],
          ),
        ),
        // 商品信息部分
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16),
          child: Row(
            children: [
              // 商品图片
              SizedBox(
                width: 100,
                child: Image.network(
                  // 这里假设图片网络地址，你需替换为实际地址
                  "https://img2.baidu.com/it/u=1121799572,1124250415&fm=253&fmt=auto&app=138&f=JPEG?w=514&h=500",
                  fit: BoxFit.cover,
                ),
              ),
              const SizedBox(width: 16),
              // 商品描述
              Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    const Text(
                      "茶水分离杯耐热隔热玻璃杯茶水分离杯耐热隔热玻璃杯",
                      maxLines: 2,
                      overflow: TextOverflow.ellipsis,
                    ),
                    const SizedBox(height: 8),
                    const Text(
                      "规格: 白色240ml",
                      style: TextStyle(color: Colors.grey),
                    ),
                    const SizedBox(height: 8),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        const Text(
                          "¥119.5",
                          style: TextStyle(fontSize: 16),
                        ),
                        const Text(
                          "x 2",
                          style: TextStyle(fontSize: 16),
                        ),
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
        // 合计金额
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.end,
            children: const [
              Text(
                "合计: ¥ 239",
                style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
              ),
            ],
          ),
        ),
        // 再次购买按钮
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
          child: Center(
            child: OutlinedButton(
              onPressed: () {},
              child: const Text("再次购买"),
            ),
          ),
        ),
      ],
    );
  }
}
